home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 February: Tool Chest / Dev.CD Feb 94.toast / Tool Chest / Development Platforms / MPW Related / MPW Interfaces / PInterfaces / Serial.p < prev    next >
Encoding:
Text File  |  1993-09-17  |  2.1 KB  |  103 lines  |  [TEXT/MPS ]

  1. {
  2.     File:        Serial.p
  3.  
  4.     Copyright:    © 1983-1993 by Apple Computer, Inc.
  5.                 All rights reserved.
  6.  
  7.     Version:    System 7.1 for ETO #11
  8.     Created:    Tuesday, March 30, 1993 18:00
  9.  
  10. }
  11.  
  12. {$IFC UNDEFINED UsingIncludes}
  13. {$SETC UsingIncludes := 0}
  14. {$ENDC}
  15.  
  16. {$IFC NOT UsingIncludes}
  17.     UNIT Serial;
  18.     INTERFACE
  19. {$ENDC}
  20.  
  21. {$IFC UNDEFINED UsingSerial}
  22. {$SETC UsingSerial := 1}
  23.  
  24. {$I+}
  25. {$SETC SerialIncludes := UsingIncludes}
  26. {$SETC UsingIncludes := 1}
  27. {$IFC UNDEFINED UsingTypes}
  28. {$I $$Shell(PInterfaces)Types.p}
  29. {$ENDC}
  30. {$SETC UsingIncludes := SerialIncludes}
  31.  
  32. CONST
  33. baud300 = 380;
  34. baud600 = 189;
  35. baud1200 = 94;
  36. baud1800 = 62;
  37. baud2400 = 46;
  38. baud3600 = 30;
  39. baud4800 = 22;
  40. baud7200 = 14;
  41. baud9600 = 10;
  42. baud19200 = 4;
  43. baud57600 = 0;
  44. stop10 = 16384;
  45. stop15 = -32768;
  46. stop20 = -16384;
  47. noParity = 0;
  48. oddParity = 4096;
  49. evenParity = 12288;
  50. data5 = 0;
  51. data6 = 2048;
  52. data7 = 1024;
  53. data8 = 3072;
  54. ctsEvent = 32;
  55. breakEvent = 128;
  56. xOffWasSent = 128;
  57. dtrNegated = 64;
  58. ainRefNum = -6;     {serial port A input}
  59. aoutRefNum = -7;    {serial port A output}
  60. binRefNum = -8;     {serial port B input}
  61. boutRefNum = -9;    {serial port B output}
  62.  
  63. TYPE
  64. SPortSel = (sPortA,sPortB);
  65.  
  66.  
  67. SerShk = PACKED RECORD
  68.     fXOn: Byte;     {XOn flow control enabled flag}
  69.     fCTS: Byte;     {CTS flow control enabled flag}
  70.     xOn: CHAR;      {XOn character}
  71.     xOff: CHAR;     {XOff character}
  72.     errs: Byte;     {errors mask bits}
  73.     evts: Byte;     {event enable mask bits}
  74.     fInX: Byte;     {Input flow control enabled flag}
  75.     fDTR: Byte;     {DTR input flow control flag}
  76.     END;
  77.  
  78. SerStaRec = PACKED RECORD
  79.     cumErrs: Byte;
  80.     xOffSent: Byte;
  81.     rdPend: Byte;
  82.     wrPend: Byte;
  83.     ctsHold: Byte;
  84.     xOffHold: Byte;
  85.     END;
  86.  
  87.  
  88. FUNCTION SerReset(refNum: INTEGER;serConfig: INTEGER): OSErr;
  89. FUNCTION SerSetBuf(refNum: INTEGER;serBPtr: Ptr;serBLen: INTEGER): OSErr;
  90. FUNCTION SerHShake(refNum: INTEGER;flags: SerShk): OSErr;
  91. FUNCTION SerSetBrk(refNum: INTEGER): OSErr;
  92. FUNCTION SerClrBrk(refNum: INTEGER): OSErr;
  93. FUNCTION SerGetBuf(refNum: INTEGER;VAR count: LONGINT): OSErr;
  94. FUNCTION SerStatus(refNum: INTEGER;VAR serSta: SerStaRec): OSErr;
  95.  
  96.  
  97. {$ENDC}    { UsingSerial }
  98.  
  99. {$IFC NOT UsingIncludes}
  100.     END.
  101. {$ENDC}
  102.  
  103.